#include "mylib.h"
#include <stdio.h>
#include "Table.h"
// a hack square root calculation using simple operations
double mysqrt(double x)
{
  if (x <= 0) {
    return 0;
  }
fprintf(stdout, "长度 %d", sizeof(sqrtTable));
  double tmp;
  double delta;
  tmp = x;

  int i;
  for (i = 0; i < 5; ++i) {
    if (tmp <= 0) {
      tmp = 0.1;
    }
    delta = x - (tmp * tmp);
    tmp = tmp + 0.5 * delta / tmp;
    fprintf(stdout, "sqrt of %g : %g\n", x, tmp);
  }
  return tmp;
}
